/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Server.ImplementInterface;

import Interface.IRemoteDeposit;
import Server.DTO.Deposit_DTO;
import java.rmi.RemoteException;
import java.rmi.server.ServerNotActiveException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;

/**
 *
 * @author 10520_000
 */
public class DepositObject extends UnicastRemoteObject implements IRemoteDeposit{

    public DepositObject() throws RemoteException {
        super();
    }
    
    @Override
    public int Insert(Deposit_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Insert from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return DepositRepository.Insert(info); 
    }

    @Override
    public int Update(Deposit_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Update from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return DepositRepository.Update(info); 
    }

    @Override
    public int Delete(Deposit_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Delete from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return DepositRepository.Delete(info); 
    }

    @Override
    public ArrayList FindAll() throws RemoteException {
        try {
            System.out.println("Invoke Update from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return DepositRepository.FindAll(); 
    }

    @Override
    public ArrayList FindbyDetailID(String DetailID) throws RemoteException {
        try {
            System.out.println("Invoke Update from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return DepositRepository.FindByDepositID(DetailID); 
    }
    
}
